<!--
 * Copyright ©
 * #  
 * @author: zw
 * @date: 2022-03-24 
 -->


<template>
  <el-row class=" h-full">
    <el-col class="mt-60 bg-red-200 h-full" :span="6">
      <img src="static/image/bg1.png" alt="">
    </el-col>
    <el-col class="mt-60" :span="12" style="height: 400px">
      <el-table :data="resultDialog.table" height="100%" highlight-current-row stripe row-key="id" :tree-props="{ children: 'children' }">
        <el-table-column align="center" type="index" label="#" width="50" />
        <el-table-column align="center" prop="ipAddress" label="IP地址" :formatter="ipAddressFormat" />
        <el-table-column align="center" prop="macAddress" label="MAC地址" width="180" />
        <el-table-column align="center" prop="name" label="服务名称" />
        <el-table-column align="center" prop="manufacturer" label="厂商" width="180" />
        <el-table-column align="center" prop="portid" label="端口" />
        <el-table-column align="center" prop="resultType" label="类型" :formatter="formatResultType" />
        <el-table-column align="center" prop="resultStatus" label="状态" :formatter="formatResultStatus" />
      </el-table>
    </el-col>
    <el-col class="mt-60 bg-blue-200 h-full" :span="6"></el-col>
  </el-row>
</template>

<script>
const random = Math.random;
const floor = Math.floor;

export default {
  name: 'Other',

  data() {
    return {
      resultDialog: {
        visible: false,
        table: [
          {
            "id": 2,
            "ipAddress": 3232235797,
            "name": "http",
            "state": "open",
            "portid": "80",
            "status": null,
            "createTime": null,
            "taskId": 49,
            "taskUuid": "4ebc9c26-9908-43bc-9e2f-b85e4d9d2848",
            "macAddress": null,
            "manufacturer": null,
            "resultType": 4,
            "resultStatus": 3
          },
          {
            "id": 3,
            "ipAddress": 3232235797,
            "name": "https",
            "state": "open",
            "portid": "443",
            "status": null,
            "createTime": null,
            "taskId": 49,
            "taskUuid": "4ebc9c26-9908-43bc-9e2f-b85e4d9d2848",
            "macAddress": null,
            "manufacturer": null,
            "resultType": 4,
            "resultStatus": 3
          },
          {
            "id": 4,
            "ipAddress": 3232235797,
            "name": "rtsp",
            "state": "open",
            "portid": "554",
            "status": null,
            "createTime": null,
            "taskId": 49,
            "taskUuid": "4ebc9c26-9908-43bc-9e2f-b85e4d9d2848",
            "macAddress": null,
            "manufacturer": null,
            "resultType": 4,
            "resultStatus": 3
          },
          {
            "id": 5,
            "ipAddress": 3232235797,
            "name": "rtmp",
            "state": "open",
            "portid": "1935",
            "status": null,
            "createTime": null,
            "taskId": 49,
            "taskUuid": "4ebc9c26-9908-43bc-9e2f-b85e4d9d2848",
            "macAddress": null,
            "manufacturer": null,
            "resultType": 4,
            "resultStatus": 3
          },
          {
            "id": 6,
            "ipAddress": 3232235797,
            "name": "ppp",
            "state": "open",
            "portid": "3000",
            "status": null,
            "createTime": null,
            "taskId": 49,
            "taskUuid": "4ebc9c26-9908-43bc-9e2f-b85e4d9d2848",
            "macAddress": null,
            "manufacturer": null,
            "resultType": 4,
            "resultStatus": 3
          },
          {
            "id": 7,
            "ipAddress": 3232235797,
            "name": "mysql",
            "state": "open",
            "portid": "3306",
            "status": null,
            "createTime": null,
            "taskId": 49,
            "taskUuid": "4ebc9c26-9908-43bc-9e2f-b85e4d9d2848",
            "macAddress": null,
            "manufacturer": null,
            "resultType": 4,
            "resultStatus": 3
          },
          {
            "id": 8,
            "ipAddress": 3232235797,
            "name": "sip-tls",
            "state": "open",
            "portid": "5061",
            "status": null,
            "createTime": null,
            "taskId": 49,
            "taskUuid": "4ebc9c26-9908-43bc-9e2f-b85e4d9d2848",
            "macAddress": null,
            "manufacturer": null,
            "resultType": 4,
            "resultStatus": 3
          },
          {
            "id": 9,
            "ipAddress": 3232235797,
            "name": "http-proxy",
            "state": "open",
            "portid": "8080",
            "status": null,
            "createTime": null,
            "taskId": 49,
            "taskUuid": "4ebc9c26-9908-43bc-9e2f-b85e4d9d2848",
            "macAddress": null,
            "manufacturer": null,
            "resultType": 4,
            "resultStatus": 3
          },
          {
            "id": 10,
            "ipAddress": 3232235797,
            "name": "blackice-icecap",
            "state": "open",
            "portid": "8081",
            "status": null,
            "createTime": null,
            "taskId": 49,
            "taskUuid": "4ebc9c26-9908-43bc-9e2f-b85e4d9d2848",
            "macAddress": null,
            "manufacturer": null,
            "resultType": 4,
            "resultStatus": 3
          },
          {
            "id": 11,
            "ipAddress": 3232235797,
            "name": "us-srv",
            "state": "open",
            "portid": "8083",
            "status": null,
            "createTime": null,
            "taskId": 49,
            "taskUuid": "4ebc9c26-9908-43bc-9e2f-b85e4d9d2848",
            "macAddress": null,
            "manufacturer": null,
            "resultType": 4,
            "resultStatus": 3
          },
          {
            "id": 12,
            "ipAddress": 3232235797,
            "name": "unknown",
            "state": "open",
            "portid": "8085",
            "status": null,
            "createTime": null,
            "taskId": 49,
            "taskUuid": "4ebc9c26-9908-43bc-9e2f-b85e4d9d2848",
            "macAddress": null,
            "manufacturer": null,
            "resultType": 4,
            "resultStatus": 3
          },
          {
            "id": 13,
            "ipAddress": 3232235797,
            "name": "d-s-n",
            "state": "open",
            "portid": "8086",
            "status": null,
            "createTime": null,
            "taskId": 49,
            "taskUuid": "4ebc9c26-9908-43bc-9e2f-b85e4d9d2848",
            "macAddress": null,
            "manufacturer": null,
            "resultType": 4,
            "resultStatus": 3
          },
          {
            "id": 14,
            "ipAddress": 3232235797,
            "name": "simplifymedia",
            "state": "open",
            "portid": "8087",
            "status": null,
            "createTime": null,
            "taskId": 49,
            "taskUuid": "4ebc9c26-9908-43bc-9e2f-b85e4d9d2848",
            "macAddress": null,
            "manufacturer": null,
            "resultType": 4,
            "resultStatus": 3
          },
          {
            "id": 15,
            "ipAddress": 3232235797,
            "name": "fmtp",
            "state": "open",
            "portid": "8500",
            "status": null,
            "createTime": null,
            "taskId": 49,
            "taskUuid": "4ebc9c26-9908-43bc-9e2f-b85e4d9d2848",
            "macAddress": null,
            "manufacturer": null,
            "resultType": 4,
            "resultStatus": 3
          },
          {
            "id": 16,
            "ipAddress": 3232235797,
            "name": "asterix",
            "state": "open",
            "portid": "8600",
            "status": null,
            "createTime": null,
            "taskId": 49,
            "taskUuid": "4ebc9c26-9908-43bc-9e2f-b85e4d9d2848",
            "macAddress": null,
            "manufacturer": null,
            "resultType": 4,
            "resultStatus": 3
          },
          {
            "id": 17,
            "ipAddress": 3232235797,
            "name": "sun-answerbook",
            "state": "open",
            "portid": "8888",
            "status": null,
            "createTime": null,
            "taskId": 49,
            "taskUuid": "4ebc9c26-9908-43bc-9e2f-b85e4d9d2848",
            "macAddress": null,
            "manufacturer": null,
            "resultType": 4,
            "resultStatus": 3
          },
          {
            "id": 18,
            "ipAddress": 3232235797,
            "name": "cslistener",
            "state": "open",
            "portid": "9000",
            "status": null,
            "createTime": null,
            "taskId": 49,
            "taskUuid": "4ebc9c26-9908-43bc-9e2f-b85e4d9d2848",
            "macAddress": null,
            "manufacturer": null,
            "resultType": 4,
            "resultStatus": 3
          },
          {
            "id": 19,
            "ipAddress": 3232235797,
            "name": "tor-orport",
            "state": "open",
            "portid": "9001",
            "status": null,
            "createTime": null,
            "taskId": 49,
            "taskUuid": "4ebc9c26-9908-43bc-9e2f-b85e4d9d2848",
            "macAddress": null,
            "manufacturer": null,
            "resultType": 4,
            "resultStatus": 3
          },
          {
            "id": 20,
            "ipAddress": 3232235797,
            "name": "glrpc",
            "state": "open",
            "portid": "9080",
            "status": null,
            "createTime": null,
            "taskId": 49,
            "taskUuid": "4ebc9c26-9908-43bc-9e2f-b85e4d9d2848",
            "macAddress": null,
            "manufacturer": null,
            "resultType": 4,
            "resultStatus": 3
          },
          {
            "id": 21,
            "ipAddress": 3232235797,
            "name": "zeus-admin",
            "state": "open",
            "portid": "9090",
            "status": null,
            "createTime": null,
            "taskId": 49,
            "taskUuid": "4ebc9c26-9908-43bc-9e2f-b85e4d9d2848",
            "macAddress": null,
            "manufacturer": null,
            "resultType": 4,
            "resultStatus": 3
          },
          {
            "id": 22,
            "ipAddress": 3232235797,
            "name": "jetdirect",
            "state": "open",
            "portid": "9100",
            "status": null,
            "createTime": null,
            "taskId": 49,
            "taskUuid": "4ebc9c26-9908-43bc-9e2f-b85e4d9d2848",
            "macAddress": null,
            "manufacturer": null,
            "resultType": 4,
            "resultStatus": 3
          },
          {
            "id": 23,
            "ipAddress": 3232235797,
            "name": "unknown",
            "state": "open",
            "portid": "19350",
            "status": null,
            "createTime": null,
            "taskId": 49,
            "taskUuid": "4ebc9c26-9908-43bc-9e2f-b85e4d9d2848",
            "macAddress": null,
            "manufacturer": null,
            "resultType": 4,
            "resultStatus": 3
          },
          {
            "id": 24,
            "ipAddress": 3232235799,
            "name": "ssh",
            "state": "closed",
            "portid": "22",
            "status": null,
            "createTime": null,
            "taskId": 49,
            "taskUuid": "4ebc9c26-9908-43bc-9e2f-b85e4d9d2848",
            "macAddress": "E4:3A:6E:2F:F0:AC",
            "manufacturer": "Shenzhen Zeroone Technology",
            "resultType": 4,
            "resultStatus": 3
          },
          {
            "id": 25,
            "ipAddress": 3232235799,
            "name": "http",
            "state": "open",
            "portid": "80",
            "status": null,
            "createTime": null,
            "taskId": 49,
            "taskUuid": "4ebc9c26-9908-43bc-9e2f-b85e4d9d2848",
            "macAddress": "E4:3A:6E:2F:F0:AC",
            "manufacturer": "Shenzhen Zeroone Technology",
            "resultType": 4,
            "resultStatus": 3
          },
          {
            "id": 26,
            "ipAddress": 3232235799,
            "name": "ppp",
            "state": "open",
            "portid": "3000",
            "status": null,
            "createTime": null,
            "taskId": 49,
            "taskUuid": "4ebc9c26-9908-43bc-9e2f-b85e4d9d2848",
            "macAddress": "E4:3A:6E:2F:F0:AC",
            "manufacturer": "Shenzhen Zeroone Technology",
            "resultType": 4,
            "resultStatus": 3
          },
          {
            "id": 27,
            "ipAddress": 3232235799,
            "name": "http-proxy",
            "state": "open",
            "portid": "8080",
            "status": null,
            "createTime": null,
            "taskId": 49,
            "taskUuid": "4ebc9c26-9908-43bc-9e2f-b85e4d9d2848",
            "macAddress": "E4:3A:6E:2F:F0:AC",
            "manufacturer": "Shenzhen Zeroone Technology",
            "resultType": 4,
            "resultStatus": 3
          },
          {
            "id": 28,
            "ipAddress": 3232235799,
            "name": "blackice-icecap",
            "state": "open",
            "portid": "8081",
            "status": null,
            "createTime": null,
            "taskId": 49,
            "taskUuid": "4ebc9c26-9908-43bc-9e2f-b85e4d9d2848",
            "macAddress": "E4:3A:6E:2F:F0:AC",
            "manufacturer": "Shenzhen Zeroone Technology",
            "resultType": 4,
            "resultStatus": 3
          },
          {
            "id": 29,
            "ipAddress": 3232235799,
            "name": "d-s-n",
            "state": "open",
            "portid": "8086",
            "status": null,
            "createTime": null,
            "taskId": 49,
            "taskUuid": "4ebc9c26-9908-43bc-9e2f-b85e4d9d2848",
            "macAddress": "E4:3A:6E:2F:F0:AC",
            "manufacturer": "Shenzhen Zeroone Technology",
            "resultType": 4,
            "resultStatus": 3
          },
          {
            "id": 30,
            "ipAddress": 3232235799,
            "name": "simplifymedia",
            "state": "open",
            "portid": "8087",
            "status": null,
            "createTime": null,
            "taskId": 49,
            "taskUuid": "4ebc9c26-9908-43bc-9e2f-b85e4d9d2848",
            "macAddress": "E4:3A:6E:2F:F0:AC",
            "manufacturer": "Shenzhen Zeroone Technology",
            "resultType": 4,
            "resultStatus": 3
          },
          {
            "id": 31,
            "ipAddress": 3232235799,
            "name": "sun-answerbook",
            "state": "open",
            "portid": "8888",
            "status": null,
            "createTime": null,
            "taskId": 49,
            "taskUuid": "4ebc9c26-9908-43bc-9e2f-b85e4d9d2848",
            "macAddress": "E4:3A:6E:2F:F0:AC",
            "manufacturer": "Shenzhen Zeroone Technology",
            "resultType": 4,
            "resultStatus": 3
          },
          {
            "id": 32,
            "ipAddress": 3232235799,
            "name": "fmtp",
            "state": "open",
            "portid": "8500",
            "status": null,
            "createTime": null,
            "taskId": 49,
            "taskUuid": "4ebc9c26-9908-43bc-9e2f-b85e4d9d2848",
            "macAddress": "E4:3A:6E:2F:F0:AC",
            "manufacturer": "Shenzhen Zeroone Technology",
            "resultType": 4,
            "resultStatus": 3
          },
          {
            "id": 33,
            "ipAddress": 3232235799,
            "name": "zeus-admin",
            "state": "open",
            "portid": "9090",
            "status": null,
            "createTime": null,
            "taskId": 49,
            "taskUuid": "4ebc9c26-9908-43bc-9e2f-b85e4d9d2848",
            "macAddress": "E4:3A:6E:2F:F0:AC",
            "manufacturer": "Shenzhen Zeroone Technology",
            "resultType": 4,
            "resultStatus": 3
          },
          {
            "id": 34,
            "ipAddress": 3232235799,
            "name": "tor-orport",
            "state": "open",
            "portid": "9001",
            "status": null,
            "createTime": null,
            "taskId": 49,
            "taskUuid": "4ebc9c26-9908-43bc-9e2f-b85e4d9d2848",
            "macAddress": "E4:3A:6E:2F:F0:AC",
            "manufacturer": "Shenzhen Zeroone Technology",
            "resultType": 4,
            "resultStatus": 3
          }
        ],
      },
    };
  },

  mounted() {

  },

  methods: {

    numberToIp(num) {
      var str;
      var tt = new Array();
      tt[0] = (num >>> 24) >>> 0;
      tt[1] = ((num << 8) >>> 24) >>> 0;
      tt[2] = (num << 16) >>> 24;
      tt[3] = (num << 24) >>> 24;
      str = String(tt[0]) + "." + String(tt[1]) + "." + String(tt[2]) + "." + String(tt[3]);
      return str;
    },
    ipAddressFormat(row, column) {
      let ip = row['ip_address'] || row[column.property];
      return this.numberToIp(ip)
    },
    formatResultType(row, column) {
      const type = { 1: '终端', 2: '摄像头', 3: '服务器', 4: '未知' };
      return type[row[column.property]];
    },
    formatResultStatus(row, column) {
      const type = { 1: '不用更新', 2: '需要更新', 3: '需要添加' };
      return type[row[column.property]];
    },
  }
  //  End
}

</script>

<style lang='css' scoped>
</style>
